package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EquipmentConfigurationMapper;
import com.ruoyi.system.domain.EquipmentConfiguration;
import com.ruoyi.system.service.IEquipmentConfigurationService;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-10
 */
@Service
public class EquipmentConfigurationServiceImpl implements IEquipmentConfigurationService 
{
    @Autowired
    private EquipmentConfigurationMapper equipmentConfigurationMapper;

    /**
     * 查询设备配置
     * 
     * @param id 设备配置主键
     * @return 设备配置
     */
    @Override
    public EquipmentConfiguration selectEquipmentConfigurationById(Long id)
    {
        return equipmentConfigurationMapper.selectEquipmentConfigurationById(id);
    }

    /**
     * 查询设备配置列表
     * 
     * @param equipmentConfiguration 设备配置
     * @return 设备配置
     */
    @Override
    public List<EquipmentConfiguration> selectEquipmentConfigurationList(EquipmentConfiguration equipmentConfiguration)
    {
        return equipmentConfigurationMapper.selectEquipmentConfigurationList(equipmentConfiguration);
    }

    /**
     * 新增设备配置
     * 
     * @param equipmentConfiguration 设备配置
     * @return 结果
     */
    @Override
    public int insertEquipmentConfiguration(EquipmentConfiguration equipmentConfiguration)
    {
        equipmentConfiguration.setCreateTime(DateUtils.getNowDate());
        return equipmentConfigurationMapper.insertEquipmentConfiguration(equipmentConfiguration);
    }

    /**
     * 修改设备配置
     * 
     * @param equipmentConfiguration 设备配置
     * @return 结果
     */
    @Override
    public int updateEquipmentConfiguration(EquipmentConfiguration equipmentConfiguration)
    {
        equipmentConfiguration.setUpdateTime(DateUtils.getNowDate());
        return equipmentConfigurationMapper.updateEquipmentConfiguration(equipmentConfiguration);
    }

    /**
     * 批量删除设备配置
     * 
     * @param ids 需要删除的设备配置主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentConfigurationByIds(String ids)
    {
        return equipmentConfigurationMapper.deleteEquipmentConfigurationByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除设备配置信息
     * 
     * @param id 设备配置主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentConfigurationById(Long id)
    {
        return equipmentConfigurationMapper.deleteEquipmentConfigurationById(id);
    }

    @Override
    public EquipmentConfiguration selectEquipmentConfigurationBySite(String site) {
        return equipmentConfigurationMapper.selectEquipmentConfigurationBySite(site);
    }
}
